package no.ntnu.fp.gui;

import javax.swing.JPanel;
import net.miginfocom.swing.MigLayout;
import no.ntnu.fp.messages.Message;

import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JButton;
import javax.swing.border.EtchedBorder;

public class MessagePanel extends JPanel {

	/**
	 * Create the panel.
	 * @param message 
	 */
	public MessagePanel(Message message) {
		setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
		setLayout(new MigLayout("", "[][][][][]", "[][][][][]"));
		
		JLabel lblTitle = new JLabel(message.getAppointment().getTitle());
		lblTitle.setFont(new Font("Dialog", Font.BOLD, 12));
		add(lblTitle, "cell 1 1");
		
		JLabel lblDescription = new JLabel(message.getMessageType().toString());
		add(lblDescription, "cell 1 2");
		
		JButton btnAccept = new JButton("Godta");
		add(btnAccept, "cell 1 4");
		
		JButton buttonCancel = new JButton("Avsl\u00E5");
		add(buttonCancel, "cell 2 4");

	}
}
